import React from 'react'
// 引入Route组件
import {
  Route,
  Link,
  Switch,
  Redirect,
  NavLink,
  withRouter,
} from 'react-router-dom'
import Home from './pages/Home'
import Detail from './pages/Detail'
import Login from './pages/Login'
function App() {
  return (
    <div>
      <NavLink to="/home" activeClassName="xxx">
        首页
      </NavLink>
      <NavLink to="/detail" activeClassName="xxx">
        详情页
      </NavLink>

      <Switch>
        {/* pathname是/home/test2 */}
        <Route path="/home" component={Home}></Route>
        <Route path="/detail" component={Detail}></Route>
      </Switch>
    </div>
  )
}
export default withRouter(App)
